﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>excel导出</title>
    <link href="@Url.Content("~/Content/css/global.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/css/main.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/css/themes/default/easyui.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/css/themes/gray/tabs.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/css/themes/icon.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/css/plan.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.8.2.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.easyui.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/reportView.js")" type="text/javascript"></script>
</head>
<body>
    <form name="excelExport" method="post" id="excelExport" action="@Url.Content("~/ReportView/ExportReportViewToExcel?rnd=" + DateTime.Now.ToFileTime())">
        <input type="submit" id="btnExportExcel" value="报表导出" style="display: none;" />
        <input type="button" id="btnExport" value="报表导出" onclick="exportExcel();" style="height: 23px; margin: 2px;" />

        <input type="hidden" name="queryType" id="queryType" />
        <input type="hidden" name="sort" id="sort" />
        <input type="hidden" name="order" id="order" />
        <input type="hidden" name="queryString" id="queryString" value="" />
        <input type="hidden" name="reportViewData" id="reportViewData" />

    </form>

    <script type="text/javascript">
        //将报表导出到excel
        var exportExcel = function () {

            var queryType = parent.getQueryType();
            $('#queryType').val(queryType);

            var data = parent.getExportQuery();
            $('#queryString').val(JSON.stringify(data));

            if (queryType != "合并工单") {
                var sortOptions = parent.getSortOptions() || {};
                $('#sort').val(sortOptions.sort);
                $('#order').val(sortOptions.order);
            }

            $('#reportViewData').val(JSON.stringify(parent.getReportViewData()));

            $('#btnExportExcel').click();
            $('button,input[type="button"]').attr('disabled', true);
            parent.enableButton(false);

            window.setTimeout(function () {
                $('button,input[type="button"]').removeAttr('disabled');
                parent.enableButton(true);
            }, 2000)
        };


    </script>
</body>
</html>
